﻿using Basic.FlowModel.DB;
using Basic.FlowRemoteModel.NodeEvent.Model;
using WeDonekRpc.Helper.IdGenerator;
using WeDonekRpc.SqlSugar;

namespace Basic.FlowDAL.lmpl
{
    internal class FlowNodeEventDAL : BasicDAL<DBFlowNodeEvent, long>, IFlowNodeEventDAL
    {
        public FlowNodeEventDAL ( IRepository<DBFlowNodeEvent> basicDAL ) : base(basicDAL, "node.event")
        {
        }
        public void Add ( NodeEventSet data )
        {
            DBFlowNodeEvent add = new DBFlowNodeEvent
            {
                Id = IdentityHelper.CreateId(),
                FlowId = data.FlowId,
                NodeId = data.NodeId,
                EventType = data.EventType,
                EventId = data.EventId
            };
            this._BasicDAL.Insert(add);
        }
    }
}
